#ifndef SERVER_H
#define SERVER_H

#include "sublogic.h"
#include "threadpoll.h"

#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/epoll.h>


#define MAX_EVENT_NUMBER 1024

threadpool_t *thp;

int setnonblocking(int fd);
void addfd( int epollfd, int fd, bool enable_et );
void delfd(int epollfd, int fd);
void ReceiveMsg(thFunctionArg* arg);
void et_mode( struct epoll_event* events, int number, int epollfd, int listenfd );
int RunServer();

#endif
